//float rotx = PI/4;
//float roty = PI/4;

import processing.core.*;


/*
void setup(){
  size(1000,800, P3D);
  noStroke();
  lights();
}


void draw(){
    background(0);

    translate(width/2.0, height/2.0, 0);

    rotateX(rotx);
  rotateY(roty);

  Pokaali pokaali = new Pokaali();
  pokaali.piirra();
}*/



public class Pokaali{
	PApplet pa;

	Pokaali(PApplet parent){
		pa = parent;
	}

	void piirra(){
		pa.pushMatrix();
		pa.translate(440,481,80);
		//pa.lights();

		pa.fill(250,250,0);


		pa.noStroke();
		//	pa.strokeWeight(0);


		kanta();

		pa.pushMatrix();

		pa.translate(0,-40,0);
		jalka();
		pa.popMatrix();

		pa.pushMatrix();
		pa.translate(0,-70,0);
		kuppi();
		pa.popMatrix();

		pa.popMatrix();
	}

	void kanta()
	{
		//  kuori(30, 10, -30, 64, img2);
		float angle = 0;
		float angleIncrement = PApplet.TWO_PI / 64; //65 on sides
		pa.beginShape(PApplet.QUAD_STRIP);
		// texture(img);
		for (int i = 0; i < 64 + 1; ++i) {
			pa.vertex(40*PApplet.cos(angle), 0, 40*PApplet.sin(angle)); //30=topRadius
			pa.vertex(10*PApplet.cos(angle), -40, 10*PApplet.sin(angle)); //10=bottomradius, -30 on tall
			angle += angleIncrement;
		}
		pa.endShape();
	}

	void jalka(){
		float angle = 0;
		float angleIncrement = PApplet.TWO_PI / 64; //64 (30) on sides
		pa.beginShape(PApplet.QUAD_STRIP);
		// texture(img);
		for (int i = 0; i < 64 + 1; ++i) {
			pa.vertex(10*PApplet.cos(angle), 0, 10*PApplet.sin(angle)); //30=topRadius
			pa.vertex(10*PApplet.cos(angle), -30, 10*PApplet.sin(angle)); //10=bottomradius, -30 on tall
			angle += angleIncrement;
		}
		pa.endShape();
	}

	void kuppi(){
		float angle = 0;
		float angleIncrement = PApplet.TWO_PI / 64; //65 on sides
		pa.beginShape(PApplet.QUAD_STRIP);
		// texture(img);
		for (int i = 0; i < 64 + 1; ++i) {
			pa.vertex(10*PApplet.cos(angle), 0, 10*PApplet.sin(angle)); //30=topRadius
			pa.vertex(60*PApplet.cos(angle), -70, 60*PApplet.sin(angle)); //10=bottomradius, -30 on tall
			angle += angleIncrement;
		}
		pa.endShape();
	}



}


